<template>
    <!-- 顶部导航 -->
    <van-nav-bar
        :title="title"
        @click-left="backBtn"
        left-arrow
        :fixed="fixed"
        :placeholder="placeholder"
    >
        <template #right>
            <van-icon name="ellipsis" />
        </template>
    </van-nav-bar>
</template>

<script lang="ts">
import { defineComponent } from "vue";
import { useRouter } from "vue-router";

export default defineComponent({
    props: ["title", "fixed", "placeholder", "back"],
    setup(props) {
        const route = useRouter();
        const backBtn = function () {
            props.back ? route.push(props.back) : route.back();
        };
        return { backBtn };
    },
});
</script>

<style lang="scss" scoped>
:deep .van-nav-bar__title {
    font-size: 14px;
}
</style>
